package work.yixin.redis.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

import work.yixin.redis.config.RedisRepository;
import work.yixin.redis.config.RedisRepositoryAspect;
import work.yixin.redis.service.RedisService;

/**
 * RedisServiceImpl
 * @author yunshang
 */
@RedisRepository(value = 1)
@Service
public class RedisServiceImpl implements RedisService {

	@RedisRepository(value = 0)
	@Override
	public Map<String, Object> getMap0() {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("Service", RedisRepositoryAspect.LocalRedisJedis.get().keys("*"));
		return map;
	}

	@RedisRepository(value = 1)
	@Override
	public Map<String, Object> getMap1() {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("Service", RedisRepositoryAspect.LocalRedisJedis.get().keys("*"));
		return map;
	}

	@RedisRepository(value = 2)
	@Override
	public Map<String, Object> getMap2() {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("Service", RedisRepositoryAspect.LocalRedisJedis.get().keys("*"));
		return map;
	}

	@Override
	public Map<String, Object> getMap3() {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("Service", RedisRepositoryAspect.LocalRedisJedis.get().keys("*"));
		return map;
	}
}
